package cars;

import java.util.LinkedList;
import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mac
 * Date: 2022-11-28
 * Time: 10:43
 */
public class VehicleList {
    LinkedList<Vehicle> list;

    public VehicleList() {
        list = new LinkedList<>();
    }

    public void printf(String velName){
        int number = 1;
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).brand.compareTo(velName) == 0){
                System.out.print(number + "." + list.get(i).type + "   ");
                number++;
            }
        }
        System.out.println();
    }
    public Vehicle find(String data1, String data2){
        return null;
    }
    public int del(String data1, String data2){
        for (int i = 0; i < list.size(); i++) {
            Vehicle vehicle = list.get(i);
            if (vehicle.brand.compareTo(data1) == 0 && vehicle.type.compareTo(data2) == 0){
                return i;
            }
        }
        return -1;
    }

    public double getPerRent(Vehicle vehicle, int days){
        return 0;
    }
}
